//
//  ThreadCtr.m
//  YetcarText
//
//  Created by ming on 17/9/5.
//  Copyright © 2017年 ming. All rights reserved.
//

#import "ThreadCtr.h"
#import "DayDataCtr.h"
#import "MonthDataCtr.h"
#import "TotalDataCtr.h"
@interface ThreadCtr ()
@property (nonatomic, strong) NSArray *titleData;
@end

@implementation ThreadCtr

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"线索";
}
- (NSArray *)titleData {
    if (!_titleData) {
        _titleData = @[@"当天数据", @"本月数据",@"累计数据"];
    }
    return _titleData;
}
#pragma mark 初始化代码
- (instancetype)init {
    if (self = [super init]) {
        
        self.titleSizeNormal = 15;
        self.titleSizeSelected = 15;
        self.menuViewStyle = WMMenuViewStyleLine;
        self.menuItemWidth = [UIScreen mainScreen].bounds.size.width / self.titleData.count;
        //栏高度
        self.menuHeight = 50;
        //导航栏颜色
        self.menuBGColor=[UIColor whiteColor];
        //滚动效果
        //  self.pageAnimatable=YES;
        //选中字体颜色
        self.titleColorSelected=[UIColor redColor];
        //未被选中字体颜色
        self.titleColorNormal=[UIColor blueColor];
        
        
    }
    return self;
}
#pragma mark - Datasource & Delegate

#pragma mark 返回子页面的个数
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return self.titleData.count;
}

#pragma mark 返回某个index对应的页面
- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    
    switch (index) {
        case 0:{
            DayDataCtr *vc = [[DayDataCtr alloc]init];
            return vc;
            
        }
            break;
            
        case 2:{
            MonthDataCtr *vc = [[MonthDataCtr alloc]init];
            return vc;
            
        }
            break;
        default:{
            TotalDataCtr *vc = [[TotalDataCtr alloc]init];
            return vc;
            
        }
            break;
    }
}


#pragma mark 返回index对应的标题
- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    
    return self.titleData[index];
}
#pragma mark tabBar系统方法
//系统方法
-(BOOL)hidesBottomBarWhenPushed{
    return YES;
}
@end
